<?php
/**
 * 查询构建器 find() select()
 * ORM get() all()
 */

namespace app\api\model;


class BannerItem extends BaseModel
{
    protected $hidden = ['img_id', 'create_time', 'delete_time', 'update_time'];

    public function image()
    {
        return $this->hasOne('Image', 'id', 'img_id');
        //return $this->belongsTo('Image', 'img_id', 'id');
    }

    public function getImgAttr($value, $data)
    {
        return $this->img_prefix($value,$data);
    }
}
